Scenario #9522: Users of a Group Can View Hosting Assets Below the Assumed Project

This scenario verifies which hosting assets are visible to a user whose JWT contains a GROUP Subject.

Properties

Required

Given

name value
nameOfGroupSubject /xyz-Service
nameOfUserSubject tst-drew_selfregistered
projectCaption D-1000111 default project

Prerequisite: Resolving the project’s UUID

In a real-world scenario, there could be multiple results and the user has to select the correct one.

HTTP GET "/api/hs/booking/projects" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "comment" : "any user which does not even need to have any roles granted yet",` \
  `#   "sub" : "uuid<tst-drew_selfregistered>",` \
  `#   "groups" : [` \
  `#     "/xyz-Service"` \
  `#   ]` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "14454da0-b24f-4201-a7d7-4c53126af96e", // projectUuid
  "caption" : "D-1000111 default project"
} ]

Fetch visible hosting assets via assigned group

The group ‘/xyz-Service’ has the role ‘hs_booking.project#14454da0-b24f-4201-a7d7-4c53126af96e:ADMIN’. // projectUuid The user ‘tst-drew_selfregistered’ is a member of the group ‘/xyz-Service’. Therefore, hosting assets below the booking project ‘D-1000111 default project’ are expected to be visible.

HTTP GET "/api/hs/hosting/assets?projectUuid=14454da0-b24f-4201-a7d7-4c53126af96e" // projectUuid \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "comment" : "any user which does not even need to have any roles granted yet",` \
  `#   "sub" : "uuid<tst-drew_selfregistered>",` \
  `#   "groups" : [` \
  `#     "/xyz-Service"` \
  `#   ]` \
  `# }` \
  -H 'Hostsharing-Assumed-Roles: hs_booking.project#14454da0-b24f-4201-a7d7-4c53126af96e:ADMIN' // projectUuid
=> status: 200 OK 
[ {
  "uuid" : "2fc4b006-7711-4d61-bbc6-b982dd712054",
  "type" : "MANAGED_WEBSPACE",
  "identifier" : "fir01",
  "caption" : "some Webspace",
  "alarmContact" : null,
  "config" : { }
}, {
  "uuid" : "5ef30ebf-aa0d-4e8b-b78f-b7b483c25a46",
  "type" : "MANAGED_SERVER",
  "identifier" : "vm1011",
  "caption" : "some ManagedServer",
  "alarmContact" : null,
  "config" : {
    "monit_max_ram_usage" : 80,
    "monit_max_ssd_usage" : 70,
    "monit_max_cpu_usage" : 90
  }
} ]

generated on 2026-07-17 01:42:23 for branch